package com.wangsd.web.report.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wangsd.common.basicbean.Result;
import com.wangsd.web.MyController;
import com.wangsd.web.report.entity.TOrder;
import com.wangsd.web.report.service.TOrderService;
import com.wangsd.web.sys.entity.SysUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author generator
 * @since 2019-09-23
 */
@Api(value = "充值记录管理", tags = "充值记录管理")
@RestController
@RequestMapping("/report/tOrder")
public class TOrderController extends MyController {

    @Autowired
    TOrderService orderService;

    @ApiOperation(value = "查询订单列表", notes = "查询订单列表", httpMethod = "POST")
    @RequestMapping(value = "/selectList/{pageNum}/{pageSize}", method = RequestMethod.POST)
    public Result<IPage<TOrder>> selectList(@ApiParam(value = "当前页", required = true) @PathVariable("pageNum") Integer pageNum,
                                            @ApiParam(value = "每页大小", required = true) @PathVariable("pageSize") Integer pageSize,
                                            @RequestBody @ApiParam(name = "params", value = "传入json格式") TOrder params) {
        SysUser loginUser = getUserInfo();
        IPage<TOrder> resultIPage = orderService.selectList(pageNum, pageSize, params, loginUser.getCode());
        return Result.success(resultIPage);
    }
}

